<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BFC</title>
    <style>
        .container {
            /*触发父盒子bfc*/
            overflow: hidden;
            width: 600px;
            border: 2px solid black;
            /*    高度靠内容撑开*/
        }

        .box1 {
            /*浮动触发bfc*/
            float: left;
            width: 200px;
            height: 200px;
            background-color: blue;
        }


    </style>
</head>
<body>
<div class="container">
    <div class="box1">内容</div>
</div>

</body>
</html>